#include <bits/stdc++.h>
using namespace std;
int n;
const int N = 1e6 + 10;
int primes[N], ans;
bool st[N];

void get_primes(int n) {
	for (int i = 2; i <= n; ++i) {
		if (!st[i]) {
			primes[ans++] = i;
			for (int j = i + i; j <= n; j += i) {
				st[j] = true;
			}
		}
	}
}

int main() {
	cin >> n;
	get_primes(n);
	cout << ans;
	return 0;
}